import { PeriodicTaskDetailResolver } from './periodic-task-detail.resolver';
import { PeroidicTaskDetailComponent } from './peroidic-task-detail/peroidic-task-detail.component';
import { PeroidicTaskAddPageComponent } from './peroidic-task-add-page/peroidic-task-add-page.component';
import { PeroidicTaskOverviewComponent } from './peroidic-task-overview/peroidic-task-overview.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
  { path: '', redirectTo: 'overview', pathMatch: 'full' },
  { path: 'overview', component: PeroidicTaskOverviewComponent },
  { path: 'add', component: PeroidicTaskAddPageComponent },
  {
    path: 'detail/:id',
    component: PeroidicTaskDetailComponent,
    resolve: { task: PeriodicTaskDetailResolver }
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class PeroidicTaskRoutingModule { }
